<?php

use think\migration\Migrator;
use think\migration\db\Column;

class ControlPlanFromTsinghuaModel extends Migrator
{
    /**
     * 清华预案 - 经李博士的模型
     */
    public function change()
    {
        $table = $this->table('control_plan_from_tsinghua_model');
        $table
            //相关ID
            ->addColumn('tsinghua_plan_id', 'integer', ['limit' => 11, 'comment'=>'预案名称应的ID',])
            ->addColumn('company_id', 'integer', ['limit' => 11, 'comment'=>'公司ID',])
            ->addColumn('drain_id', 'integer', ['limit' => 11, 'comment'=>'排口ID',])
            ->addColumn('facility_id', 'integer', ['limit' => 11, 'comment'=>'设施ID',])
            ->addColumn('facility_type', 'integer', ['limit' => 11, 'comment'=>'设施类型1脱硝1脱硫，对比应facility表',])

            //参数
            ->addColumn('operating_concentration', 'decimal', ['comment'=>'运行浓度',])
            ->addColumn('operating_efficiency', 'decimal', ['comment'=>'运行效率',])
            ->addColumn('pulp_supply', 'decimal', ['comment'=>'供浆量',])
            ->addColumn('circulating_pump_witching_state', 'decimal', ['comment'=>'循环泵运行组合',])
            ->addColumn('calcium_sulfur_ratio', 'decimal', ['comment'=>'钙硫比',])
            ->addColumn('liquid_gas_ratio', 'decimal', ['comment'=>'液气比',])

            //时间
            ->addColumn('create_time', 'string', ['limit' => 50, 'comment' => '插入时间'])

            //注释
            ->setComment('管控 - 经李博士导出的模型')

            //引擎
            ->setEngine('InnoDB')
            ->save();
    }
}
